package com.ucas.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller()
public class SystemController {
	@RequestMapping("/")
	public String loginPage(Model model,HttpServletRequest request) {
		model.addAttribute("name","张红伟");
		return "login";
	}
	@RequestMapping("/index")
	public String indexPage() {
		return "index";
	}
	@RequestMapping("/title")
	public String titlePage() {
		return "title";
	}
	@RequestMapping("/center")
	public String centerPage() {
		return "center";
	}
	@RequestMapping("/register")
	@ResponseBody
	public void registerUser(@RequestBody String json,String age) {
		System.out.println(json);
		System.out.println(age);
	}
}
